<template>
  <div>
    <h2>App</h2>
    <input ref="inp" type="text" />
    <button @click="clickFn">聚焦</button>
  </div>
  <testCom ref="testRef"></testCom>
  <button @click="getCom">获取组件</button>
</template>

<script setup>
import testCom from './components/test-com.vue'
import { onMounted, ref } from 'vue'
const inp = ref(null)
onMounted(() => {
  //  console.log(inp.value)
  //  inp.value.focus()
})

const clickFn = () => {
  inp.value.focus()
}

const testRef = ref(null)
const getCom = () => {
  console.log(testRef.value)
}
console.log(inp)
</script>
